<?php

class Application_Form_FormLogin extends Zend_Form
{

    public function init()
    {
        $this->setName('userlogin');
        $this->setMethod('POST');
        
        $user = new Zend_Form_Element_Text('user');
        $user->setLabel('用户名')
                ->setRequired(TRUE)
                ->setAttrib('class','border')
                ->addFilter('StringTrim')
                ->addValidator('NotEmpty');
        
        $pwd = $this->createElement('password', 'pwd');
        $pwd->setLabel('密码')
                ->setRequired(true)
                ->setAttrib('class','border')
                ->addValidator('stringLength', FALSE, array(6,20));
        
        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setAttrib('id', 'submitbutton')
                ->setAttrib('class', 'submit')
                ->setLabel('登录');
        
        $this->addElements(array($user,$pwd,$submit));
    }


}

